package com.allin.social;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.umeng.socialize.UMShareAPI;

import java.util.HashMap;

/**
 * Description:
 *
 * @author: guoyongping
 * @date: 2016/2/23 16:04
 */
public class CustomShareActivity extends Activity {

    private Button btn_share;

    private SharePopupWindow sharePopupWindow;

    private HashMap umSocialMap;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        btn_share = (Button) findViewById(R.id.button2);

        umSocialMap = new HashMap();
        umSocialMap.put("photoPath","http://img05.allinmd.cn/public1/M00/00/03/oYYBAFU7h0aAENH9AAdHc1cakhY575_c.png");
        umSocialMap.put("customer_h5_page_url","http://m.allinmd.cn//html/m/topic//2015/04/03/1428055913994.html");
        umSocialMap.put("sinaContentString","（@唯医社区）http://10.10.32.2/html/pages/conference/meeting-place.html?conId=1452824978174&conName=%E7%AC%AC34%E5%B1%8AISMISS%E5%AD%A6%E6%9C%AF%E5%A4%A7%E4%BC%9A%20%E6%9A%A82016%E4%B8%AD%E5%9B%BD%E5%BE%AE%E5%88%9B%E8%84%8A%E6%9F%B1%E5%A4%96%E7%A7%91%E5%A4%A7%E4%BC%9A%E5%AD%A6%E6%9C%AF%E6%97%A5%E7%A8%8B&share=app");
        umSocialMap.put("messageContentString","我刚在#唯医#发现了一个不错的话题《艾氏人体解剖视频全集盛大来袭》 http://m.allinmd.cn//html/m/topic//2015/04/03/1428055913994.html");
        umSocialMap.put("wxAndQQTitleString","艾氏人体解剖视频全集盛大......—唯医话题");
        umSocialMap.put("wxAndQQContentString","");

        btn_share.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                sharePopupWindow = new SharePopupWindow(CustomShareActivity.this,umSocialMap);
                sharePopupWindow.showPopupWindow(btn_share, DensityUtil.dip2px(CustomShareActivity.this, -110), 0);
            }
        });
    }


    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        /** attention to this below ,must add this**/
        UMShareAPI.get(this).onActivityResult(requestCode, resultCode, data);
    }

}
